import 'package:fl_radial_menu/fl_radial_menu.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';

class RdialMenuPage extends StatefulWidget {
  @override
  _RdialMenuPageState createState() => new _RdialMenuPageState();
}

class _RdialMenuPageState extends State<RdialMenuPage> {

  final mainItems = [
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.red,
            () => print('red')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.green,
            () => print('green')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.blue,
            () => print('blue')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.yellow,
            () => print('yellow')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.purple,
            () => print('purple')),
  ];

  final fabItems = [
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.red,
            () => print('red')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.green,
            () => print('green')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.blue,
            () => print('blue')),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Sundrywn"),
      ),
      body: Center(child: RadialMenu(mainItems, isClockwise: false,)),
      floatingActionButton: RadialMenu(fabItems, fanout: Fanout.topLeft,),
    );
  }

  Widget _buildListView() {
    return ListView.builder(
      itemBuilder: (context, index) {
        return _buildListViewItem(index);
      },
      itemCount: sundrys.length,
    );
  }

  Widget _buildListViewItem(index) {
    return Container(
      padding: EdgeInsets.all(10.0),
      alignment: Alignment.center,
      child: sundrys[index],
    );
  }
}

List<Widget> sundrys = <Widget>[
  Column(
    children: <Widget>[
      Text("Sundrywn"),
      Container(
        height: 150,
        child: Text("Sundrywn"),
      ),
    ],
  ),
];
